<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>vue实例生命周期函数</title>
		<script src="js/vue.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<div id="app"></div>
	</body>
	<script type="text/javascript">
		//生命周期函数是vue实例在某一点时间点会自动执行的函数
		var vm = new Vue({
			el:'#app',
			template:'<div>{{test}}</div>',
			data:{
				test:'hello world'
			},
			beforeCreate:function(){
				console.log("beforeCreate");
			},
			created:function(){
				console.log('created');
			},
			beforeMount:function(){
				console.log("beforeMount");
			},
			mounted: function() {
				console.log('mounted');
			},
			beforeDestroy: function(){
				console.log('beforeDestroy');
			},
			destroyed: function(){
				console.log('destroyed');
			},
			beforeUpdate: function(){
				console.log('beforeUpdate');
			},
			updated: function(){
				console.log('updated');
			}
		});
	</script>
</html>
